package org.grow.took.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.grow.took.entity.Player;
import org.grow.took.entity.PlayerQueryCondition;

import java.util.List;

/**
 * @Author: xwg
 * @CreateDate: 2021/9/8
 */

@Mapper
public interface PlayerDao extends BaseMapper<Player> {
    List<Player> findByName(@Param("name") String username);
//升级成分页 不需要动 xml 文件
//    List<Player> dynamicQuery(@Param("qc") PlayerQueryCondition qc);
    IPage<Player> dynamicQuery(IPage<Player> page,@Param("qc") PlayerQueryCondition qc);

    int updateGoldCoinByCode(@Param("code") String code,
                             @Param("gold") Integer goldCoin,
                             @Param("version") Integer lastVersion);
    Player findByCode(@Param("code") String code);
}
